<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/Css/style.css" />
    <script type="text/javascript" src="__PUBLIC__/Admin/Js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Admin/Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Admin/Js/bootstrap.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Admin/Js/ckform.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Admin/Js/common.js"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form action="index.html" method="post" class="definewidth m20" >
<input type="hidden" name="id" value="{$role.role_id}" />
<table class="table table-bordered table-hover definewidth m10">
    <tr>
        <td width="10%" class="tableleft">标题</td>
        <td><label/>{$role.role_name}</label></td>
    </tr>
    <!--<tr>-->
        <!--<td class="tableleft">状态</td>-->
        <!--<td>-->
            <!--<input type="radio" name="status" value="1" checked /> 启用-->
           <!--<input type="radio" name="status" value="0"  /> 禁用-->
        <!--</td>-->
    <!--</tr>-->
    <tr>
        <td class="tableleft">权限</td>
        <td><ul><li><label class='checkbox inline'><input type='checkbox' name='group[]' value='' />公用节点</label>
                    <ul>
                        <li><label class='checkbox inline'><input type='checkbox' name='node[]' value='21' checked/>省市区级联数据</label>
                        <li><label class='checkbox inline'><input type='checkbox' name='node[]' value='22' checked/>省市区数据获取</label>
                     </ul>
                </li>
            </ul>
            <ul>
                <foreach name="auth_info" item="value" >

                    <li>
                        <label class='checkbox inline'><input type='checkbox' name='group[]' value='{$value.auth_id}'/>{$value.auth_name}</label>
                        <ul>
                            <foreach name="value.child" item="sub_value">
                                <li><label class='checkbox inline'><input type='checkbox' name='node[]' value='{$sub_value.auth_id}'  <if condition="in_array($sub_value['auth_id'],$role_info)"> checked='checked'
                                 </if> />{$sub_value.auth_name}</label>
                            </foreach>
                        </ul>

                    </li>
                </foreach>
            </ul>
        </td>
    </tr>
    <tr>
        <td class="tableleft"></td>
        <td>
            <button type="submit" class="btn btn-primary" type="button">保存</button> &nbsp;&nbsp;<button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
        </td>
    </tr>
</table>
</form>
</body>
</html>
<script>
    $(function () {
        $(':checkbox[name="group[]"]').click(function () {
            $(':checkbox', $(this).closest('li')).prop('checked', this.checked);
        });

		$('#backid').click(function(){
				window.location.href="index.html";
		 });

    });
</script>